#pragma once
#include "resource.h"       // main symbols

#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>
#include <atlcoll.h>
#include <atlstr.h>

#include "Config.h"

using namespace ATL;


class CHtmlWindowImpl
	: public CWindowImpl<CHtmlWindowImpl, CWindow, 
		CWinTraits<WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SIZEBOX|WS_SYSMENU, WS_EX_TOOLWINDOW> >
{
private:
public:

	CHtmlWindowImpl() {

	}

	DECLARE_WND_CLASS_EX(NULL, 0, 0)

	BEGIN_MSG_MAP(CSlideOut)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
//		MESSAGE_HANDLER(WM_SIZE, OnSize)
//		MESSAGE_HANDLER(WM_ERASEBKGND, OnErase)
///		CHAIN_MSG_MAP(CAxWindow<CHtmlWindowImpl>)
//		DEFAULT_REFLECTION_HANDLER()
	END_MSG_MAP()

	void OnFinalMessage(HWND /*hWnd*/)
	{
		::PostQuitMessage(0);
	}

	LRESULT OnDestroy(UINT , WPARAM , LPARAM , BOOL& bHandled)
	{
		bHandled = FALSE;
		return 0;
	}
	LRESULT OnCreate(UINT , WPARAM , LPARAM , BOOL& )
	{
		return 0;
	}

	// Rather than allowing the window to be destroyed, we will
	// just hide it so it can be rapidly shown the next time.
	LRESULT OnClose(UINT, WPARAM, LPARAM, BOOL& bHandled) {
		bHandled=TRUE;
		ShowWindow(SW_HIDE);
		return 0;
	}

	LRESULT OnErase(UINT , WPARAM , LPARAM , BOOL& )
	{
		return 1;
	}
};

